<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <title>注册</title>
    <link rel="stylesheet" href="__STATIC_URL__/static/mobile/css/weui.css" />
    <script src="__STATIC_URL__/static/js/jquery-2.1.4.min.js"></script>

    <script src="__STATIC_URL__/static/layer/layer.js"></script>

    <style>
        .titinfo{
            width: 100%;
            height: 8rem;
            text-align: center;
            color: #007f41;
            line-height: 12rem;
        }
        .titcenter{
            width: 100%;
            height: 100%;
        }
        .title{
            margin:0 auto;
        }
        .weui-cell{
            color: #333;
            font-size: 1em;
        }
        .weui-input{
            font-size: 0.8em;
        }
        .weui-btn {
            border-radius: 3px;
            background: #0591AA;
        }
    </style>
</head>

<body>
<div class="container" id="container">

        <div class="titinfo">
            <div class="titcenter">
                <img src="__STATIC_URL__/static/img/logo.png" alt="">
            </div>
        </div>
        <form method="post" id="formcate">
            <div class="weui-cells weui-cells_form">
                <input type="hidden" id="card_id" name="card_id" value="{$user['card_id']}" >
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">用户名</label></div>
                    <div class="weui-cell__bd">
                        <input class="weui-input" type="text" name="username" value="" placeholder="请输入您的用户名" id="username">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">密码</label></div>
                    <div class="weui-cell__bd">
                        <input class="weui-input" type="password" name="password" value="" placeholder="请输入您的密码" id="password">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">客户名称</label></div>
                    <div class="weui-cell__bd">
                        <input class="weui-input" type="text"  value="{$user['name']}" disabled placeholder="请输入您的客户名称" id="name">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">联系人</label></div>
                    <div class="weui-cell__bd">
                        <input class="weui-input" type="text"  value="{$user['name']}" disabled placeholder="请输入您的联系人" id="contactor">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">手机号</label></div>
                    <div class="weui-cell__bd">
                        <input class="weui-input" type="text"  value="{$user['phone']}" disabled id="phone">
                    </div>
                </div>



            </div>
            <button class="weui-btn weui-btn_primary" type="button" onclick="but();" style="margin-top: 50px; width: 90%;margin-bottom:20px;">注册</button>
        </form>


</div>
</body>
<script>
    function but(){
        var username=$("#username").val();

        var password = $('#password').val();
        var cardid = $('#card_id').val();




        if(username==""){
            layer.msg('请填写用户名！');
            return false;
        }

        if(password==""){
            layer.msg('请填写密码！');
            return false;
        }



        $.ajax({
            url: "{:url('')}",
            type: "post",
            data: $("#formcate").serialize(),
            success: function (data) {
                // console.log(data);
                if(data.code==0){
                    layer.msg(data.message);
                    setTimeout(function(){
                        window.location.href = data.url;

                    },1500)
                }else{
                    layer.msg(data.message);
                }
            }
        })
    }
</script>

</html>